
// const { Sequelize, DataTypes } = require("sequelize");
const { STRING, INTEGER, LONGSTRING } = require('../types')

module.exports = (sequelize) => {
  const expense = sequelize.define(
    'expense',
    {// 在这里定义模型属性
      id: {
        type: INTEGER,
        primaryKey:true,
        autoIncrement:true,
        allowNull:false
      },
      createTime: { // 创建时间
        type: STRING,
      },
      creator: { // 作者
        type: STRING,
      },
      creatorId: { // 作者
        type: STRING,
      },
      title: { // 标题
        type: STRING,
      },
      content: { // 内容
        type: LONGSTRING,
      },
      type: {
        type: STRING,
      },
      lang: {
        type: STRING,
      },
      status: {
        type: STRING,
      },
      isDelete: {
        type: STRING,
      },
      deleteTime: {
        type: STRING,
      }
    },
    {
    tableName: "expense",//直接提供表名
    timestamps: false
   }
  );
  return expense
}
